<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@ page import="java.util.*,
                 com.kylin.common.*,
                 com.kylin.common.util.*,
                 com.kylin.module.user.orm.*,
				 com.kylin.module.shop.orm.*,
				 com.kylin.common.dict.orm.Dict,
                 com.kylin.common.paginate.DisplayPage,
                 com.kylin.module.community.orm.Member
				 " %>
<%@ include file="/common/include/pageExpires.jsp"%>
<%@ include file="/common/include/currUserInfo.jsp"%>

<%
	if(currUser.getUserrole().equals(Constants.USER_ROLE_COMPANY) ){
		Company[] user_companys = (Company[])currUser.getSubs().toArray(new Company[0]);
		Company curr_company = (Company)user_companys[0];
	
	    for(int i=0;i<user_companys.length;i++){
	    	if(user_companys[i].getLanguage().equals(sessionLocale.toString()) ) 
			    curr_company = user_companys[i];
	    }
	    session.setAttribute(Constants.CURR_LANG_COMPANY,curr_company);  
	    response.sendRedirect("/module/shop/company/manage1.jsp");
	}else{
	     List subs = (List)currUser.getSubs() ;
	     if(subs != null){
	         session.setAttribute(Constants.CURR_MEMBER,(Member)subs.get(0)); 
	     }
	     else{
	          response.sendRedirect("/");
	          return;
	     }
	      // 跳转到个人空间
         response.sendRedirect("/module/community/member/post.do?task=mypost");

	}
	out.println(Constants.CURR_MEMBER+"==="+session.getAttribute(Constants.CURR_USER));
%>